package com.zzg.demo.springbatch.demo.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@AllArgsConstructor(staticName = "of")
@NoArgsConstructor
public class PersonEntity {
    @NotBlank(message = "姓名不能为空")
    private String name;
    @NotNull(message = "年龄不能为空")
    private Integer age;

    private Integer changeAge;

    @Override
    public String toString() {
        return String.format("姓名：%s，年龄：%s，更改后的年龄：%s", name, age, changeAge);
    }
}
